function getRegExpMatchArr(sentence, pattern) {
    // console.log("getRegExpMatchArr");
    let regExpMatchArr = [];
    for (const regExpMatch of sentence.matchAll(pattern)) {
        regExpMatchArr.push(regExpMatch);
    }

    return regExpMatchArr;
}

function getWords(theString) {
    // console.log("gettting word");
    let result = [];
    let splits = theString.split(/[^a-zA-Z]+/);
    for (const split of splits) {
        if (split && split != "") {
            result.push(split);
        }
    }
    return result;
}

export {getRegExpMatchArr, getWords}
// module.exports = {getRegExpMatchArr, getWords}
